package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EvVehicleMapper;
import com.ruoyi.system.domain.EvVehicle;
import com.ruoyi.system.service.IEvVehicleService;

/**
 * 电动车信息Service业务层处理
 * 
 * @author wtd1
 * @date 2025-11-15
 */
@Service
public class EvVehicleServiceImpl implements IEvVehicleService 
{
    @Autowired
    private EvVehicleMapper evVehicleMapper;

    /**
     * 查询电动车信息
     * 
     * @param vehicleId 电动车信息主键
     * @return 电动车信息
     */
    @Override
    public EvVehicle selectEvVehicleByVehicleId(Long vehicleId)
    {
        return evVehicleMapper.selectEvVehicleByVehicleId(vehicleId);
    }

    /**
     * 查询电动车信息列表
     * 
     * @param evVehicle 电动车信息
     * @return 电动车信息
     */
    @Override
    public List<EvVehicle> selectEvVehicleList(EvVehicle evVehicle)
    {
        return evVehicleMapper.selectEvVehicleList(evVehicle);
    }

    /**
     * 新增电动车信息
     * 
     * @param evVehicle 电动车信息
     * @return 结果
     */
    @Override
    public int insertEvVehicle(EvVehicle evVehicle)
    {
        evVehicle.setCreateTime(DateUtils.getNowDate());
        return evVehicleMapper.insertEvVehicle(evVehicle);
    }

    /**
     * 修改电动车信息
     * 
     * @param evVehicle 电动车信息
     * @return 结果
     */
    @Override
    public int updateEvVehicle(EvVehicle evVehicle)
    {
        evVehicle.setUpdateTime(DateUtils.getNowDate());
        return evVehicleMapper.updateEvVehicle(evVehicle);
    }

    /**
     * 批量删除电动车信息
     * 
     * @param vehicleIds 需要删除的电动车信息主键
     * @return 结果
     */
    @Override
    public int deleteEvVehicleByVehicleIds(Long[] vehicleIds)
    {
        return evVehicleMapper.deleteEvVehicleByVehicleIds(vehicleIds);
    }

    /**
     * 删除电动车信息信息
     * 
     * @param vehicleId 电动车信息主键
     * @return 结果
     */
    @Override
    public int deleteEvVehicleByVehicleId(Long vehicleId)
    {
        return evVehicleMapper.deleteEvVehicleByVehicleId(vehicleId);
    }
}
